<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Job extends Start_Controller {

	public function __construct(){
		parent::__construct();
		$this->load->_model('model_job','job');
	}


	public function index()
	{
		$this->_job();
	}
	public function resume(){

		$this->data['classname'] = '我要应聘';

		$id = $this->uri->segment(3);

		//获取招聘信息
		$this->data['data'] = $this->job->read($id);


		//设置标题
		$this->data['pagename'] = '我要应聘 '.$this->data['data']['position'];

		$this->_template('job_resume',$this->data);
	}

	/**
	 *  单页信息处理
	 */
	public function _job(){



		$per_page = 10;
		$id = $this->uri->segment(2);
	 	$page = $this->uri->segment(3);

	     if(empty($page)){
	        $start = 0;
	     }else{
	        $start = ($page-1)*$per_page;
	     }

		//取得信息列表
		$data['list'] = $this->job->find_all("",'*','',$start, $per_page);
		//分页
		$config['base_url'] = site_url('job/'.$id);
		$config['total_rows'] = $this->job->find_count();
		$config['per_page'] = $per_page;
		$config['uri_segment'] = 3;
		//分页数据显示的标签
		$config['full_tag_open'] = '<div>';
		$config['full_tag_close'] = '</div>';
		//当前页的其实标签 ?: 加粗一下
		$config['cur_tag_open'] = '<b>';
		$config['cur_tag_close'] = '</b>';
		$config['prev_link'] = '上一页';
		$config['next_link'] = '下一页';
		$config['use_page_numbers'] = TRUE;
		//当前页先后个显示的个数
		$config['num_links'] = 9;

		$this->load->library('pagination'); //载入分页类
		$this->pagination->initialize($config);
		$page = $this->pagination->create_links();

		$data['page'] =  $page;



			$this->data['pagename'] = '人才招聘';



		$this->data['classname'] = '人才招聘';
		$this->data['list'] = $data['list'];
		$this->data['page'] = $data['page'];


		$this->_template('job',$this->data);








    }





}









